import jwt
from d1104.settings import SECRET_KEY
def gen_token(user):
    payload={
        'username':user
    }
    token=jwt.encode(payload=payload,key=SECRET_KEY,algorithm='HS256')
    return token